package com.zz.parkingsystem.controller.user;

import com.zz.parkingsystem.service.ShowVOService;
import com.zz.parkingsystem.util.Result;
import com.zz.parkingsystem.util.ResultGenerator;
import com.zz.parkingsystem.vo.ShowVO;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
//模板消息/停车缴费
@ResponseBody
@Controller
@RequestMapping("/tosb")
@Api(value = "",tags = "订单申诉接口")
public class ToSbController {
    @Autowired
    private ShowVOService showVOService;
    @PutMapping("")
    //待支付和已支付的申诉
    public Result tosb(@RequestBody  ShowVO showVO){
        if(showVO.getState()!=2 && showVO.getState()!=3){
            return ResultGenerator.genFailResult("订单状态不正确，不能申诉");
        }
        showVOService.update(showVO);
        return ResultGenerator.genSuccessResult("申诉成功");
    }
}
